package com.cmyshare.design.strategyAndFactorySpring;

/**
 * @version 1.0
 * @Author cmy
 * @Date 2025/10/13 16:20
 * @desc 支付结果实体类
 */
// 支付结果实体类
public class PaymentResult {
    private boolean success;        // 支付是否成功
    private String message;         // 支付结果描述
    private String transactionId;   // 支付交易号
    private long timestamp;         // 支付时间戳

    // 构造函数、getter和setter
    public PaymentResult(boolean success, String message, String transactionId) {
        this.success = success;
        this.message = message;
        this.transactionId = transactionId;
        this.timestamp = System.currentTimeMillis();
    }

    public boolean isSuccess() {
        return success;
    }

    public String getMessage() {
        return message;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public long getTimestamp() {
        return timestamp;
    }

    @Override
    public String toString() {
        return "PaymentResult{" +
                "success=" + success +
                ", message='" + message + '\'' +
                ", transactionId='" + transactionId + '\'' +
                ", timestamp=" + timestamp +
                '}';
    }
}

